package com.boco.modules.fdoc.web.sigserverpack;



import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.boco.common.web.ServletController;
import com.boco.modules.fdoc.model.SigSvsPackDtlRlnEntity;
import com.boco.modules.fdoc.service.SigSvsPackDtlRlnService;
import com.boco.modules.fdoc.vo.SigServicepackVo;

@Controller
@RequestMapping(value = "/sigserverpack")
public class AddSigSvsPackDtlCtr extends ServletController {
	@Resource
	SigSvsPackDtlRlnService sigSvsPackDtlRlnServie;

	@RequestMapping(value = "/addSvsPackDtl", method = RequestMethod.POST)
	public String addSvsPackDtl(SigServicepackVo vo, HttpServletRequest request, HttpServletResponse response,
			Model model) {
		int sigId=vo.getSgId();
		int[] svsPackDtlIds = vo.getSvsPackDtlIds();
		System.out.println("===================================" + svsPackDtlIds + "=" + sigId
				+ "====================================");
			SigSvsPackDtlRlnEntity sigSvsPackDtlRlnEntity = null;
			for (int svsPackDtlId : svsPackDtlIds) {
				System.out.println(svsPackDtlId + "===================服务详情列表");
				sigSvsPackDtlRlnEntity = new SigSvsPackDtlRlnEntity();
				sigSvsPackDtlRlnEntity.setSigId(sigId);
				sigSvsPackDtlRlnEntity.setDelFlag("0");
				sigSvsPackDtlRlnEntity.setDetailsId(svsPackDtlId);
				sigSvsPackDtlRlnServie.insertSvsPackDtlInfo(sigSvsPackDtlRlnEntity);
			}
			request.setAttribute("successadd", "新增成功");
			return "/sigsvspack/stsDteSvsPackDtl";
			}	
	}

